
import { createSlice, } from "@reduxjs/toolkit";

//权限
const globalState = {
	token: "",
	userInfo: "",
};

const globalSlice = createSlice({
	name: "global",
	initialState: globalState,
	reducers: {
		setToken(state, { payload }) {
			state.token = payload;
		},
		update(state, { payload }) {
			state.token = payload;
		},
	}
});

export const { setToken, update } = globalSlice.actions;
export default globalSlice.reducer;
